<script>
$(document).ready(function() {
	<?php
	if($added == 1) echo 'showNoti("Bình luận: '.$name.'", "Trả lời bình luận thành công!", "Ok");';
	if($failed == 1) echo 'showNoti("Bình luận: '.$name.'", "Trả lời bình luận thất bại!", "Err");';
    ?>
});
</script>
<?php
echo form_open_multipart($action, array('id' => 'updateFrm'));
echo form_input(array('type' => 'hidden', 'name' => 'token', 'value' => $GLOBALS['var']['token']));
echo form_input(array('type' => 'hidden', 'name' => 'id', 'value' => $info['id']));
echo form_input(array('type' => 'hidden', 'name' => 'parentid', 'value' => $info['id']));
echo module_open();
?>
<tr>
	<td class="head">Bình luận</td>
</tr>
<tr>
	<td class="fr">
		<div class="commentName">
			<strong><?php echo $info['info'] ?></strong>
			<hr style="margin: 5px 0px;" />
			<p><?php echo $info['name'] ?> [<?php echo $info['email'] ?>]</p>
			<p>Thời gian: <?php echo $info['date_added'] ?></p>
			<p>Like: <?php echo $info['like'] ?> | Dislike: <?php echo $info['dislike'] ?></p>
		</div>
		<div class="replies" style="float: left; height: 300px; overflow-y: hidden">
			<table>
			<?php
			$replies = $method->list_replycomment($info['id']);
			if(is_array($replies) && count($replies))
			{
				foreach ($replies as $row)
				{
			?>
			<tr id="<?php echo $row['id'] ?>" name="<?php echo $row['email'] ?>">
				<td>
					<div class="reply-list" style="float: none; position: relative;">
						<div style="position: absolute; bottom: 5px; left: 5px;">
							<?php echo change_status($row['id'], $row['active'], 'active', 'Hiển thị') ?>
							<a href="javascript:;" title="Xóa" class="delRestoreLink" data-id="<?php echo $row['id'] ?>"><div class="icon glyphicons bin" style="margin-top: -3px;"></div></a>
						</div>
						<p style="float: right"><?php echo $row['date_added'] ?></p>
						<strong><?php echo $row['user'] ?></strong> [<?php echo $row['email'] ?>]
						<hr style="margin: 5px 0px;" />
						<?php echo $row['info'] ?>
						<p style="text-align: right; padding-top: 10px;">Like: <?php echo $row['like'] ?> | Dislike: <?php echo $row['dislike'] ?></p>
					</div>
				</td>
			</tr>
			<?php
				}
			}
			?>
				<tr class="highlight"><td></td></tr>
			</table>
		</div>
	</td>
</tr>
<tr>
	<td class="head">Trả lời mới</td>
</tr>
<tr>
    <td class="fr">
    	<div class="tdleft clr320">Tên người gửi <span style="color:red">*</span></div>
    	<div class="tdright clr320">
	        <input type="text" data-required="1" name="name" id="name" value="<?php echo $admin ?>" style="width:250px;" />
	        <div class="errordiv name"><div class="arrow"></div>Vui lòng nhập tên người gửi!</div>
	    </div>
    </td>
</tr>
<tr>
    <td class="fr">
    	<div class="tdleft clr320">Email người gửi <span style="color:red">*</span></div>
    	<div class="tdright clr320">
	        <input type="text" data-required="1" name="email" id="email" value="<?php echo $email ?>" style="width:250px;" />
	        <div class="errordiv email"><div class="arrow"></div>Vui lòng nhập email người gửi!</div>
	    </div>
    </td>
</tr>
<tr>
	<td class="fr">
		<div class="tdleft clr320">Nội dung</div>
		<div class="tdright clr320"><textarea class="textarea" id="replytext" name="replytext" style="width: 100%; height: 150px"></textarea></div>
	</td>
</tr>
<?php echo module_close(); ?>
<script>
$(document).ready(function() {
	$('.replies').slimScroll({
	    size: '4px',
	    height: '300px',
	});
});
</script>